/*    */ package com.zimbra.soap;
/*    */ 
/*    */ import com.zimbra.common.localconfig.KnownKey;
/*    */ import com.zimbra.common.localconfig.LC;
/*    */ import com.zimbra.common.service.ServiceException;
/*    */ import com.zimbra.common.util.Log;
/*    */ import com.zimbra.common.util.ZimbraLog;
/*    */ import com.zimbra.cs.extension.ExtensionUtil;
/*    */ import com.zimbra.cs.session.RemoteSoapSession;
/*    */ import com.zimbra.cs.session.SoapSession;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class SoapSessionFactory
/*    */ {
/* 28 */   private static SoapSessionFactory sSessionFactory = null;
/*    */   
/*    */   public static synchronized SoapSessionFactory getInstance() {
/* 31 */     if (sSessionFactory == null) {
/* 32 */       String className = LC.zimbra_class_soapsessionfactory.value();
/* 33 */       if ((className != null) && (!className.equals(""))) {
/*    */         try {
/*    */           try {
/* 36 */             sSessionFactory = (SoapSessionFactory)Class.forName(className).newInstance();
/*    */           }
/*    */           catch (ClassNotFoundException cnfe) {
/* 39 */             sSessionFactory = (SoapSessionFactory)ExtensionUtil.findClass(className).newInstance();
/*    */           }
/*    */         } catch (Exception e) {
/* 42 */           ZimbraLog.account.error("could not instantiate SoapSessionFactory class '" + className + "'; defaulting to SoapSessionFactory", e);
/*    */         }
/*    */       }
/* 45 */       if (sSessionFactory == null) {
/* 46 */         sSessionFactory = new SoapSessionFactory();
/*    */       }
/*    */     }
/* 49 */     return sSessionFactory;
/*    */   }
/*    */   
/*    */   public SoapSession getSoapSession(ZimbraSoapContext zsc) throws ServiceException {
/* 53 */     if (zsc.isAuthUserOnLocalhost()) {
/* 54 */       return new SoapSession(zsc);
/*    */     }
/* 56 */     return new RemoteSoapSession(zsc);
/*    */   }
/*    */ }


/* Location:              /home/mint/zimbrastore.jar!/com/zimbra/soap/SoapSessionFactory.class
 * Java compiler version: 7 (51.0)
 * JD-Core Version:       0.7.1
 */